//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System.Windows;
using System.Windows.Controls.Primitives;
using Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule;

namespace Microsoft.Research.ScientificWorkflow.ManagementStudioControls
{
    /// <summary>
    /// This interface is used by the Management studio modules. It contains the left pane control,
    /// the centre pane content and the selector toggle button.
    /// </summary>
    public interface ILeftPaneControl
    {
        string ObjectName { get; set; }
        UIElement LeftPaneContent { get; set; }
        UIElement MainContent { get; set; }
        ToggleButton Selector { get; set; }
        
        /// <summary>
        /// Saves the changes on the view.
        /// </summary>
        /// <returns>
        /// Value indicating success or failure of the save.
        /// </returns>
        SaveStateHandler SaveChanges();
    }

    /// <summary>
    /// Encapsulates the save state of the save operation. Holds an enum that tells if the save
    /// operation was invalid or valid.
    /// </summary>
    public class SaveStateHandler
    {
        /// <summary>
        /// Gets or sets the save option selected.
        /// </summary>
        /// <value>The save option selected.</value>
        public SaveStatus SaveOptionSelected { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SaveStateHandler"/> class.
        /// </summary>
        /// <param name="choice">The choice.</param>
        public SaveStateHandler(SaveStatus choice)
        {
            this.SaveOptionSelected = choice;
        }
    }

    /// <summary>
    /// The save status.
    /// </summary>
    public enum SaveStatus
    {
        /// <summary>
        /// Valid save.
        /// </summary>
        Valid,

        /// <summary>
        /// Invalid save.
        /// </summary>
        Invalid
    }
}
